package com.sunjy.services;

import com.sunjy.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

/**
 * Created by sunjy on 2018/9/6.
 */
@Service
public class Services1 {

    @Autowired
    private MongoTemplate mongoTemplate;

    public void test(){
        User user=new User();
        user.setId(1);
        user.setAge(10);
        user.setName("sunjy1");
        mongoTemplate.insert(user);

    }
}
